Constructors

Link copied to clipboard
constructor(client: MinecraftClient, entryBuilders: List<BiFunction<DynamicListWidget, Int, out DynamicListWidget.Entry>>, x: Int, y: Int, width: Int, height: Int, spec: DynamicListWidget.ListSpec = ListSpec())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class ListSpec(val leftPadding: Int = 16, val rightPadding: Int = 10, val verticalPadding: Int = 4, val hideScrollBar: Boolean = false, val listNarrationKey: String = "fc.narrator.position.config")
Link copied to clipboard
data class Scope(val scope: String, val group: String = "", val inGroups: List<String> = EMPTY)
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
open override var lastSelected: Element?

getter and setter for the cached element.

Link copied to clipboard
var message: Text
Link copied to clipboard
Link copied to clipboard
open override val neighbor: EnumMap<NavigationDirection, Neighbor>
Link copied to clipboard
@Nullable
@get:Nullable
var tooltip: Tooltip?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var x: Int
Link copied to clipboard
var y: Int

Functions

Link copied to clipboard
override fun appendNarrations(builder: NarrationMessageBuilder)
Link copied to clipboard
open override fun bottomDelta(): Int

The length in pixels that the bottom of the list is out of frame below the bottom of the widget.

Link copied to clipboard
open fun charTyped(chr: Char, modifiers: Int): Boolean
Link copied to clipboard
open override fun contentHeight(): Int

The height of the entries in the list. If the list contains twenty 20px entries, content height is 400

Link copied to clipboard
open fun drawTexture(context: DrawContext, texture: Identifier, x: Int, y: Int, u: Int, v: Int, hoveredVOffset: Int, width: Int, height: Int, textureWidth: Int, textureHeight: Int)
Link copied to clipboard
open override fun ensureVisible(entry: DynamicListWidget.Entry)

Ensures that the provided entry is in frame. Implementations should scroll as needed to fully incorporate the entry into the widget frame.

Link copied to clipboard
open override fun entryAtY(mouseY: Int): DynamicListWidget.Entry?

The entry underneath the mouse, if any.

Link copied to clipboard
fun fitToContent(max: Int)
Link copied to clipboard
open fun focusOn(@Nullable element: Element?)
Link copied to clipboard
open override fun forEachChild(consumer: Consumer<ClickableWidget>)
Link copied to clipboard
open override fun getFocused(): Element?
Link copied to clipboard
@Nullable
open fun getFocusedPath(): GuiNavigationPath?
Link copied to clipboard
open override fun getHeight(): Int
Link copied to clipboard
open override fun getNavigationFocus(): ScreenRect
Link copied to clipboard
open override fun getNavigationPath(navigation: GuiNavigation?): GuiNavigationPath?

Return a navigation path leading through this list and to an entry, as applicable. The default implementation will likely not function properly; see DynamicListWidget for an example implementation

Link copied to clipboard
open fun getNeighbor(direction: NavigationDirection): Neighbor?
Link copied to clipboard
open override fun getType(): Selectable.SelectionType
Link copied to clipboard
open override fun getWidth(): Int
Link copied to clipboard
Link copied to clipboard
open override fun handleContext(contextType: ContextType, position: Position): Boolean

Handle a context event. This will be triggered by a parent, typically on key press or mouse click. A parent object can of course also be a context handler, handle context as applicable and then pass the event downstream for further handling.

Link copied to clipboard
open override fun handleScroll(verticalAmount: Double): Boolean

Handles a scroll input. This is scroll from a mouse, so the input should be multiplied by a factor to make scroll distance reasonable.

Link copied to clipboard
open override fun handleScrollByBar(scrollAmount: Int): Boolean

Handles "direct" scroll input. This amount is not scaled, so the amount input should be the amount scrolled.

Link copied to clipboard
open override fun hideScrollWhileNotHovered(): Boolean

Whether the scroll bar should not render if the widget isn't hovered. Default false.

Link copied to clipboard
open fun hoveredElement(mouseX: Double, mouseY: Double): Optional<Element>
Link copied to clipboard

Entries that are currently visible in the list frame. These entries will be rendered as applicable. Entries partially in frame should be included.

Link copied to clipboard
open override fun isFocused(): Boolean
Link copied to clipboard
open fun isHovered(): Boolean
Link copied to clipboard
open override fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open override fun isNarratable(): Boolean
Link copied to clipboard
open fun isSelected(): Boolean
Link copied to clipboard
open override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun listNarrationKey(): String
Link copied to clipboard
open override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean
Link copied to clipboard
open fun mouseMoved(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseScrolled(mouseX: Double, mouseY: Double, verticalAmount: Double): Boolean
Link copied to clipboard
open fun onClick(mouseX: Double, mouseY: Double)
Link copied to clipboard
open fun onRelease(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun onReposition()

This is run when the widget is moved or resized. List elements should be repositioned when this is called.

Link copied to clipboard
fun page(up: Boolean)

"Pages" the list up or down as if Page Up/Down has been pressed.

Link copied to clipboard
open fun playDownSound(soundManager: SoundManager)
Link copied to clipboard
open override fun popLast()

Indicates that the overlay has been removed and the parent should return focus to the cached element, if any, in lastSelected

Link copied to clipboard
open override fun provideContext(builder: ContextResultBuilder)

Add a set of grouped context action builders to a result

Link copied to clipboard
open override fun pushLast()

Indicates to the parent element to cache it's current focused element. The current focused element should be stored in lastSelected

Link copied to clipboard
open override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open override fun resetHover(mouseX: Double, mouseY: Double)

When called the parent element should reselect a hovered element based on the supplied mouse positions, if it tracks such things

Link copied to clipboard
fun rowWidth(): Int

The content width of the row, excluding padding and space for the scroll bar

Link copied to clipboard
fun rowX(): Int

The X position of the row content, after padding

Link copied to clipboard
open override fun scrollToBottom(): Boolean

Scroll to the bottom of the list content. bottomDelta should be 0 or negative after this scroll

Link copied to clipboard
Link copied to clipboard
open override fun scrollToTop(): Boolean

Scroll to the top of the list content. topDelta should be 0 after this scroll.

Link copied to clipboard
fun search(searchInput: String): Int
Link copied to clipboard

List entries tht are currently selectable. Hidden or otherwise disabled entries should not be counted in this list.

Link copied to clipboard
open fun setAlpha(alpha: Float)
Link copied to clipboard
open override fun setFocused(focused: Boolean)
open override fun setFocused(focused: Element?)
Link copied to clipboard
open override fun setH(height: Int)
Link copied to clipboard
open fun setNeighbor(direction: NavigationDirection, neighbor: Neighbor?)
Link copied to clipboard
open override fun setSuggestionWindowElement(element: Element?)
Link copied to clipboard
open fun setTooltipDelay(delay: Int)
Link copied to clipboard
open override fun setW(width: Int)
Link copied to clipboard
open fun setWidth(width: Int)
Link copied to clipboard
Link copied to clipboard
open override fun topDelta(): Int

The length in pixels that the top of the list is out of frame above the top of the widget.